var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; $jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b>>0,$jscomp.propertyToPolyfillSymbol[g]=$jscomp.IS_SYMBOL_NATIVE? $jscomp.global.Symbol(g):$jscomp.POLYFILL_PREFIX+c+"$"+g),$jscomp.defineProperty(m,$jscomp.propertyToPolyfillSymbol[g],{configurable:!0,writable:!0,value:b})))};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},b={};try{return b.__proto__=a,b.a}catch(c){}return!1}; $jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null;$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b>>0)+"_",m=0,g=function(t){if(this instanceof g)throw new TypeError("Symbol is not a constructor");return new b(c+(t||"")+"_"+m++,t)};return g},"es6","es3"); $jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c)'+ return_capicom_message),l.return();case 3:return e?l.yield(e.propset_Certificate(a.certificate),5):(c('\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 CAdESCOM.CPSigner!
\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c)'+ return_capicom_message),l.return());case 5:return l.setCatchFinallyBlocks(7),l.yield(cadesplugin.CreateObjectAsync("CAdESCOM.CadesSignedData"),9);case 9:return k=l.yieldResult,l.yield(e.propset_Options(m.CAPICOM_CERTIFICATE_INCLUDE_OPTION.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY),10);case 10:return l.yield(k.propset_ContentEncoding(1),11);case 11:return a.isBase64?l.yield(k.propset_Content(a.message),13):l.yield(k.propset_Content(Base64.encode(a.message)),13);case 13:return a.cosign&&void 0!=a.cosign? l.yield(k.VerifyCades(a.cosign,1),18):l.yield(k.SignCades(e,1),20);case 18:return l.yield(k.CoSignCades(e,1),19);case 19:n=l.yieldResult;l.jumpTo(17);break;case 20:n=l.yieldResult;case 17:return l.yield(a.certificate.PublicKey(),21);case 21:return q=l.yieldResult,l.yield(q.Algorithm,22);case 22:return u=l.yieldResult,l.yield(u.Value,23);case 23:return p=l.yieldResult,isEmpty(n)?l.return(!1):(m.user_certificate=a.certificate,b(n,p,a.certificate),l.return(!0));case 7:r=l.enterCatchBlock(),c(r),l.jumpToEnd()}})})}, getCertificatesList:function(a,b){var c=this;cadesplugin.async_spawn(function t(g){var d,e,k,n,q,u,p,r,l,v,h,D,y,x,z,A,E,B,F,G,C,H,I;return $jscomp.generator.createGenerator(t,function(f){switch(f.nextAddress){case 1:return f.setCatchFinallyBlocks(2),f.yield(cadesplugin.CreateObjectAsync("CAdESCOM.Store"),4);case 4:return d=f.yieldResult,f.yield(d.Open(),5);case 5:f.leaveTryBlock(3);break;case 2:return f.enterCatchBlock(),b("\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e"), f.return(!1);case 3:return e=[],k=!0,f.setCatchFinallyBlocks(6),f.yield(d.Certificates,8);case 8:return n=f.yieldResult,f.yield(n.Count,9);case 9:q=f.yieldResult;f.leaveTryBlock(7);break;case 6:return f.enterCatchBlock(),b("\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f"), f.return(!1);case 7:if(!q||!k)return b("\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0430 \u0412\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0432\u0443\u044e\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b.
\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f"), f.return(!1);u=1;case 10:if(!(u<=q)){f.jumpTo(12);break}f.setCatchFinallyBlocks(13);return f.yield(n.Item(u),15);case 15:p=f.yieldResult;f.leaveTryBlock(14);break;case 13:return r=f.enterCatchBlock(),b("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432: "+c.getErrorMessage(r)),f.return(!1);case 14:return l=new Date,f.yield(p.ValidFromDate,16);case 16:return v= f.yieldResult,l.setTime(Date.parse(v)),h=new Date,f.yield(p.ValidToDate,17);case 17:return D=f.yieldResult,h.setTime(Date.parse(D)),f.yield(p.SubjectName,18);case 18:return y=f.yieldResult.split(", "),x={},isEmpty(y)||Ext.each(y,function(w){w=w.split("=");x[w[0]]=w[1]}),f.yield(p.IssuerName,19);case 19:return z=f.yieldResult.split(", "),A={},isEmpty(z)||Ext.each(z,function(w){w=w.split("=");A[w[0]]=w[1]}),f.yield(p.Thumbprint,20);case 20:return E=f.yieldResult,f.setCatchFinallyBlocks(21),f.yield(p.PrivateKey, 23);case 23:B=f.yieldResult;f.leaveTryBlock(22);break;case 21:f.enterCatchBlock(),B=!1;case 22:return f.yield(p.SerialNumber,24);case 24:return F=f.yieldResult,f.yield(p.PublicKey(),25);case 25:return G=f.yieldResult,f.yield(G.Algorithm,26);case 26:return C=f.yieldResult,f.yield(C.Value,27);case 27:return H=f.yieldResult,f.yield(C.FriendlyName,28);case 28:I=f.yieldResult;e.push({thumbprint:E,owner:x.SN&&x.G?x.SN+" "+x.G:x.CN,valid_from:l,valid_till:h,owner_info:x,issuer_info:A,privateKey:B,serial:F, object:p,algo_oid:H,algo_name:I});u++;f.jumpTo(10);break;case 12:return a(e),f.return(!0)}})})},constructor:function(a){App.Crypto.CadesAsync.superclass.constructor.call(this,a)},signFileByHashByCertificate:function(a,b,c){var m=this;cadesplugin.async_spawn(function d(t){var e,k,n,q,u,p,r,l,v;return $jscomp.generator.createGenerator(d,function(h){switch(h.nextAddress){case 1:return n="",h.setCatchFinallyBlocks(2),h.yield(cadesplugin.CreateObjectAsync("CAdESCOM.CPSigner"),4);case 4:e=h.yieldResult; h.leaveTryBlock(3);break;case 2:return h.enterCatchBlock(),c('\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 CAdESCOM.CPSigner!
\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c)'+ return_capicom_message),h.return();case 3:return e?h.yield(e.propset_Certificate(a.certificate),5):(c('\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 CAdESCOM.CPSigner!
\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f Browser plug-in \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c)'+ return_capicom_message),h.return());case 5:return h.setCatchFinallyBlocks(7),h.yield(cadesplugin.CreateObjectAsync("CAdESCOM.CadesSignedData"),9);case 9:return k=h.yieldResult,h.yield(e.propset_Options(m.CAPICOM_CERTIFICATE_INCLUDE_OPTION.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY),10);case 10:return h.yield(k.propset_ContentEncoding(1),11);case 11:return h.yield(a.certificate.PublicKey(),12);case 12:return q=h.yieldResult,h.yield(q.Algorithm,13);case 13:return u=h.yieldResult,h.yield(u.Value,14); case 14:return p=h.yieldResult,h.yield(cadesplugin.CreateObjectAsync("CAdESCOM.HashedData"),15);case 15:switch(r=h.yieldResult,p){case cadesplugin.OID_ALGORITHM_CP_GOST_3411_2001:return h.jumpTo(16);case cadesplugin.OID_ALGORITHM_CP_GOST_3411_2012_256:return h.jumpTo(17);case cadesplugin.OID_ALGORITHM_CP_GOST_3411_2012_512:return h.jumpTo(18);default:return c("\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 OID "+ p+" \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e"),h.return()}case 16:return h.yield(r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411),20);case 20:h.jumpTo(19);break;case 17:return h.yield(r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256),21);case 21:h.jumpTo(19);break;case 18:return h.yield(r.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512),22);case 22:h.jumpTo(19);break;case 19:return h.yield(r.propset_DataEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY), 23);case 23:return h.yield(r.SetHashValue(a.hash),24);case 24:return h.setCatchFinallyBlocks(25),h.yield(k.SignHash(r,e,1),27);case 27:n=h.yieldResult;h.leaveTryBlock(26,7);break;case 25:return l=h.enterCatchBlock(7),c(l.message),h.return();case 26:if(!isEmpty(n))return m.user_certificate=a.certificate,b(n,p),h.return(!0);c("\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044c");return h.return(!1);case 7:v=h.enterCatchBlock(),c(v.message), h.jumpToEnd()}})})}});function initWebpush(a){isWebPushAvailable()?navigator.serviceWorker.register("/service-worker.js?_dc=1.0.1").then(function(){a(!0)},function(b){a(!1)}):a(!1)}function isWebPushAvailable(){return"serviceWorker"in navigator&&"PushManager"in window&&"showNotification"in ServiceWorkerRegistration.prototype&&"denied"!==Notification.permission?!0:!1} function checkNotificationPermission(){return new Promise(function(a,b){if("denied"===Notification.permission)return b(Error("Push messages are blocked."));if("granted"===Notification.permission)return a();if("default"===Notification.permission)return Notification.requestPermission().then(function(c){"granted"!==c&&b(Error("Bad permission result"));a()})})} function isWebPushSubscriptionExist(a){navigator.serviceWorker.ready.then(function(b){return b.pushManager.getSubscription()}).then(function(b){return a(!!b)})} function unsubscribeWebPush(a,b){navigator.serviceWorker.ready.then(function(c){c.unregister();return c}).then(function(c){return c.pushManager.getSubscription()}).then(function(c){if(c)return c;b("\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u0443\u0436\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442")}).then(function(c){return c.unsubscribe()}).then(function(c){return a()}).catch(function(c){return b(c.message)})} function subscribeWebPush(a,b){return checkNotificationPermission().then(function(){return navigator.serviceWorker.ready}).then(function(c){return c.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:urlBase64ToUint8Array(Main.config.webpush_public_key)})}).then(function(c){return a(c)}).catch(function(c){"denied"===Notification.permission?b("\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0414\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430"): b("\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 \u043d\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f")})}; //# sourceMappingURL=mod_es6.min.js.map